import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

//------------vue
import VueDemo from '../pages/vue/VueDemo'
import ComputedProperty from '../pages/vue/ComputedProperty'
import VueWatch from '../pages/vue/VueWatch'
import VueProperty from '../pages/vue/VueProperty'
import MixinsTest from '../pages/vue/MixinsTest'
import VIf from '../pages/vue/VIf'
import VxForm from '../pages/vue/vueForm.vue'
import SlotScope from '../pages/vue/slotScope.vue'
import on from '../pages/vue/$on.vue'
//-----------vue

//------------------------angular
import AngularDemo from '../pages/angular/AngularDemo'
import HeroDashboard from '../pages/angular/HeroDashboard'
import HeroList from '../pages/angular/HeroList'
import HeroDetail from '../pages/angular/HeroDetail'
//------------------------angular

import MoviePage from '../pages/MoviePage'
Vue.use(Router)
const Foo = { template: '<div>foo</div>' }
const Bar = { template: '<div>bar</div>' }
export default new Router({
  routes: [
    {
      path: '/',
      name: 'Hello',
      component: HelloWorld
    },
    {
      path: '/foo',
      component: Foo
    },
    {
      path: '/bar',
      component: Bar
    },

    {
      path: '/vue',
      component: VueDemo,
    },
    {
      path: '/watch',
      component: VueWatch
    },
    {
      path: '/cp',
      component: ComputedProperty
    },
    {
      path: '/property',
      component: VueProperty
    },
    {
      path: '/mixins',
      component: MixinsTest
    },
    {
      path: '/vif',
      component: VIf
    },
    {
      path: '/vform',
      component: VxForm
    },
    {
      path: '/slotScope',
      component: SlotScope
    },
    {
      path: '/on',
      component: on
    },
    {
      path: '/angular',
      component: AngularDemo,
      children: [
        {
          path: '',
          redirect: 'dashboard'
        },
        {
          path: 'dashboard',
          component: HeroDashboard
        },
        {
          path: 'heroes',
          component: HeroList
        },
        {
          path: 'detail/:id',
          component: HeroDetail
        },

      ]
    },
    {
      path: '/movie',
      component: MoviePage
    }
  ]
})
